package com.tedu.egmybatis1.mapper;

import com.tedu.egmybatis1.pojo.Product;

import org.apache.ibatis.annotations.*;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.List;

@Mapper
public interface InsertProductImpl {
    //@Insert("INSERT INTO product (title,price,stock)" +
    //        "VALUES (#{title},#{price},#{stock})")//#{}中参数用于指定User对象的属性
    int insertProduct(Product product);

    //@Delete("DELETE FROM product WHERE id = #{id}")
    int deleteById(Integer id);

    //@Update("UPDATE product SET title=#{title},price=#{price},stock=#{stock} " +
    //        "WHERE id=#{id}")
    int updateProduct(Product product);

    //@Select("SELECT id,title,price,stock FROM product " +
    //        "WHERE id=#{id}")
    Product selectById(Integer id);

    //@Select("SELECT id,title,price,stock FROM product ")
    List<Product> selectProductAll();
}
